package com.example.springboot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.persistence.*;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
@Entity
@Table(name = "route_review")
@TableName("route_review")
public class RouteReview {
    @Id
    @TableId(type = IdType.AUTO)
    private Long id;
    
    @Column(name = "route_id")
    private Long routeId;
    
    private String name;
    private String avatar;
    private BigDecimal rating;
    private String content;
    
    @Column(name = "created_at")
    private Date createdAt;
    
    @ManyToOne
    @JoinColumn(name = "route_id", insertable = false, updatable = false)
    @TableField(exist = false)
    private Route route;
}